/**
 *
 */
import React, { Component } from 'react'
import { Image } from 'react-native'

import PropTypes from 'prop-types'

export default class TabBarItem extends Component {
  static propTypes = {
    focused: PropTypes.bool,
    normalImage: PropTypes.oneOfType([
      PropTypes.element,
      PropTypes.shape({ uri: PropTypes.string }),
      PropTypes.shape({ uri: PropTypes.string, width: PropTypes.number, height: PropTypes.number }),
    ]),
    selectedImage: PropTypes.oneOfType([
      PropTypes.element,
      PropTypes.shape({ uri: PropTypes.string }),
      PropTypes.shape({ uri: PropTypes.string, width: PropTypes.number, height: PropTypes.number }),
    ]),
  }

  render() {
    const { focused, selectedImage, normalImage } = this.props
    return (
      <Image source={focused ? selectedImage : normalImage} />
    )
  }
}